export class Properties {
  public constructor(
    private host: string,
    private port: number,
    private from: string,
    private authCode: string,
    private protocol: 'imap' | 'pop3',
    private useTLS: boolean
  ) {}

  // serializer
  private toJSON() {
    return {
      host: this.host,
      port: this.port,
      from: this.from,
      authCode: this.authCode,
      protocol: this.protocol,
    };
  }

  //setters
  setHost(host: string) {
    this.host = host;
    return this;
  }

  getTLS() {
    return this.useTLS;
  }

  setPort(port: number) {
    this.port = port;
    return this;
  }

  setFrom(from: string) {
    this.from = from;
    return this;
  }

  setAuthCode(authCode: string) {
    this.authCode = authCode;
    return this;
  }

  setProtocol(protocol: 'imap' | 'pop3') {
    this.protocol = protocol;
    return this;
  }

  // getters
  getHost() {
    return this.host;
  }

  getPort() {
    return this.port;
  }

  getFrom() {
    return this.from;
  }

  getAuthCode() {
    return this.authCode;
  }

  getProtocol() {
    return this.protocol;
  }
}
